import { NgModule, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';

import { ComponentsModule } from "../components/components.module";

import { HomePage } from '../pages/home/home';
import { TabsPage } from '../pages/tabs/tabs';
import { LoginPage } from '../pages/login/login';
import { SettingPage } from '../pages/setting/setting';
import { TotalPage } from '../pages/total/total';
import { SynchPage } from "../pages/synch/synch";

import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { ThemeProvider } from '../providers/theme/theme';
import { ApiProvider } from '../providers/api/api';
import { BackProvider } from '../providers/back/back';
import { LoginProvider } from '../providers/login/login';
import { HttpClientModule,HTTP_INTERCEPTORS } from '@angular/common/http';
import { StorageProvider } from '../providers/storage/storage'; 
import { InterceptorService } from '../interceptors/http.interceptor';
import { NotificationProvider } from '../providers/notification/notification';
import { ToolProvider } from '../providers/tool/tool';
import { ZBar } from '@ionic-native/zbar';


@NgModule({
  declarations: [
    MyApp, 
    HomePage,
    TabsPage,
    LoginPage,
    SettingPage,
    TotalPage,
    SynchPage
  ],
  imports: [
    BrowserModule,
    ComponentsModule,
    HttpClientModule,
    IonicModule.forRoot(MyApp)
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    HomePage,
    TabsPage,
    LoginPage,
    SettingPage,
    TotalPage,
    SynchPage 
  ],
  providers: [
    StatusBar,
    SplashScreen,
    ComponentsModule,
    {provide: ErrorHandler, useClass: IonicErrorHandler},
    {provide: HTTP_INTERCEPTORS, useClass: InterceptorService,multi:true},
    ThemeProvider,
    ApiProvider,
    BackProvider,
    LoginProvider,
    StorageProvider,
    NotificationProvider,
    ToolProvider,
    ZBar
  ]
})
export class AppModule {}
